/**
 * 
 */
package com.jian.JNIMS.entity;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * <p> Project name:JNIMS </p>
 * <p> Class name:Stu_train </p>
 * @author "JiHongru"
 * @version
 * @date 2020年2月9日下午6:25:28
 * @description
 *
 */
@Entity
@Table(name = "stu_train")
public class Stu_train {

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private int id;
	
	@OneToOne
	@JoinColumn(name = "trainId", referencedColumnName = "id")
	private Train train;
	
	@OneToOne
	@JoinColumn(name = "stuId", referencedColumnName = "id")
	private Student student;

	/**
	 * 
	 */
	public Stu_train() {
	}

	/**
	 * @param id
	 * @param train
	 * @param student
	 */
	public Stu_train(int id, Train train, Student student) {
		this.id = id;
		this.train = train;
		this.student = student;
	}

	/**
	 * @return the id
	 */
	public int getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(int id) {
		this.id = id;
	}

	/**
	 * @return the train
	 */
	public Train getTrain() {
		return train;
	}

	/**
	 * @param train the train to set
	 */
	public void setTrain(Train train) {
		this.train = train;
	}

	/**
	 * @return the student
	 */
	public Student getStudent() {
		return student;
	}

	/**
	 * @param student the student to set
	 */
	public void setStudent(Student student) {
		this.student = student;
	}
	
}
